# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test14
# Description:  例11.12
# Author:       ASUS
# Date:         2019/3/26
#-------------------------------------------------------------------------------


import re
#匹配Email的正则表达式
email = "[0-9a-zA-Z]+@[0-9a-zA-Z]+\.[a-zA-Z]{2,3}"
result = re.findall(email,"lining@geekori.com")
print(result)
result = re.findall(email,"abcdefg@aa")
print(result)

#匹配IPv4的正则表达式
ipv4 = "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
result = re.findall(ipv4,"这是我的IP地址：33.12.54.34，你的IP地址是100.32.53.13")
print(result)

#匹配Url的正则表达式
ur1 = "https?:/{2}.+"
url1 = "https://geekori.com"
url2 = "ftp://geekori.com"
print(re.match(ur1,url1))
print(re.match(ur1,url2))